<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {

   public function index(){
        $search = M('search');//实例化news对象
        //查询招领和失物启事的个数
        $this->searchnum=$search->count();
        //查询已结的招领和失物启事个数
        $searchnumover=$search->count();
        //查询未失物启事的个数,  同时获取所有的置顶的失物启事
        //查询未结的招领启事
        $this->searchlist=$search->order('id desc')->limit(4)->select();
    $this->display();
}

}